package com.share.common.rabbit.MqConfig;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;


/**
 *
 */
@Slf4j
public class MsgSendConfirmCallBack implements RabbitTemplate.ConfirmCallback{
    @Override
    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        log.info("MsgSendConfirmCallBack  , 回调id:" + correlationData);
        if (ack) {
            log.info("消息消费成功");
        } else {
            log.info("消息消费失败:" + cause+"\n重新发送");
        }
    }
}
